# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=ruby-thor
pkgver=1.3.2
pkgrel=0
pkgdesc="toolkit for building powerfull command-line interfaces"
url="http://whatisthor.com/"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-rspec"
options="!check" # requires simplecov / coverall
source="$pkgname-$pkgver.tar.gz::https://github.com/rails/thor/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/thor-$pkgver"

build() {
	gem build thor.gemspec
}

check() {
	rspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		thor

	rm -r "$gemdir"/cache \
		"$gemdir"/extensions \
		"$gemdir"/doc
}

sha512sums="
fb2aff3cf8c14f1a8b38db77579e4b27292f9578c7abf8fb892da888bee7e24412c4bdbf85ce9e43982348f72e038cacc856500268fc204e44fa61f3f9405c32  ruby-thor-1.3.2.tar.gz
"
